package com.atguigu.spzx.manager.mapper;

import com.atguigu.spzx.model.dto.system.SysRoleDto;
import com.atguigu.spzx.model.entity.system.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ClassName: SysRoleMapper
 * Package: com.atguigu.spzx.manager.mapper
 * Description:
 *
 * @Author 刘强
 * @Create 2024/7/1 16:31
 * @Version 1.0
 */
@Mapper
public interface SysRoleMapper {
    List<SysRole> findByPage(@Param("sysRoleDto") SysRoleDto sysRoleDto);

    void sysRoleMapper(@Param("sysRole") SysRole sysRole);

    void updateSysRole(@Param("sysRole") SysRole sysRole);

    void deleteSysRoleById(@Param("id") Long id);

    /**
     * 查询所有角色
     * @return
     */
    List<SysRole> findAllRoles();

    /**
     * 查询该用户已经拥有的角色的ID
     * @param userId
     * @return
     */
    List<Long> findByUserId(Long userId);
}
